CODE_ROOT = $(shell cd ../../; pwd)
include $(CODE_ROOT)/Rules.make

INCLUDES= -I$(CODE_ROOT)/include/
LIBS = -L$(CODE_ROOT)/lib/ -lss_time -lss_exception


SRC = $(wildcard *.cpp)
#OBJS := $(patsubst %.cpp, %.o, $(SRC))

OBJS = logger.o singlelog.o
SUBDIR  = log

TARGET = libss_log.a
EXE = test_logger

CXXFLAGS += $(INCLUDES) 

all: $(OBJS) $(TARGET) #$(EXE)
	@if [ ! -d ../../include/$(SUBDIR)/ ]; then \
	mkdir ../../include/$(SUBDIR)/; \
	fi
	cp -f *.h ../../include/$(SUBDIR)/
	cp -f $(TARGET) ../../lib/

$(TARGET): $(OBJS)
	ar -crs $@ $^ 

#$(EXE): 
#	$(CXX) $(CXXFLAGS) -o $(EXE) logger.o $(LIBS)
	
clean:
	rm -rf $(OBJS) $(TARGET) $(EXE)
	rm -rf ../../include/$(SUBDIR)/*.*
	rm -rf ../../lib/$(TARGET)
